<script src="js/generate/template.js"></script>
<script src="js/generate/templateParam.js"></script>
<script src="js/generate/templateStructure.js"></script>
<div class="layui-row layui-col-space10" style="width: 100%;">
    <div class="layui-col-md4">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend>模板</legend>
        </fieldset>
        <form id="templateSearchForm" class="layui-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">模板名称</label>
                    <div class="layui-input-inline" style="width: 120px;">
                        <input type="text" name="hbgtName" placeholder="请输入模板名称"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                    <button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="templateSearch"
                            style="margin-left: 15px;"
                    >查询
                    </button>
                </div>
            </div>
        </form>
        <table id="templateTable" lay-filter="templateTable"></table>
        <div id="templateTableToolBar" style="display: none;">
            <div class="layui-inline" lay-event="add" title="新增"><i class="layui-icon layui-icon-add-1"></i></div>
        </div>
        <div id="templateTableItemToolBar" style="display: none;">
            <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="edit" title="编辑">&#xe642;</a>
            &nbsp;&nbsp;
            <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="remove" title="删除">&#xe640;</a>
        </div>
    </div>
    <div class="layui-col-md4">
        <!-- 自定义参数 -->
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend>参数</legend>
        </fieldset>
        <form id="templateParamSearchForm" class="layui-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">参数名称</label>
                    <div class="layui-input-inline" style="width: 120px;">
                        <input type="text" name="paramName" placeholder="请输入参数名称"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                    <button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="templateParamSearch"
                            style="margin-left: 15px;"
                    >查询
                    </button>
                </div>
            </div>
        </form>
        <table id="templateParamTable" lay-filter="templateParamTable"></table>
        <div id="templateParamTableToolBar" style="display: none;">
            <div class="layui-inline" lay-event="add" title="新增"><i class="layui-icon layui-icon-add-1"></i></div>
        </div>
        <div id="templateParamTableItemToolBar" style="display: none;">
            <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="edit" title="编辑">&#xe642;</a>
            &nbsp;&nbsp;
            <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="remove" title="删除">&#xe640;</a>
        </div>
    </div>
    <div class="layui-col-md4">
        <!-- 模板文件结构 -->
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend>文件结构</legend>
        </fieldset>
        <div id="templateStructureTree" style=" margin-top: 15px;"></div>
    </div>
</div>
<div id="popLayer" style="display: none;">
    <div id="templateDiv" class="popLayer" style="display: none;">
        <form id="templateForm" class="layui-form" lay-filter="templateForm" style="width: 400px;margin-top: 30px;">
            <input type="hidden" name="hbgtId"/>
            <div class="layui-form-item">
                <label class="layui-form-label">模板名称</label>
                <div class="layui-input-block">
                    <input type="text" name="hbgtName" required lay-verify="required" placeholder="请输入模板名称"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">模板权限</label>
                <div class="layui-input-block">
                    <select name="authority" lay-verify="required">
                        <option value=""></option>
                        <option value="1">私有</option>
                        <option value="2">公开</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">模板说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="请输入模板说明"
                              class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: right">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="templateSave">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <div id="templateParamDiv" class="popLayer" style="display: none;">
        <form id="templateParamForm" class="layui-form" lay-filter="templateParamForm"
              style="width: 400px;margin-top: 30px;">
            <input type="hidden" name="hbgtpId"/>
            <input type="hidden" name="hbgtId"/>
            <div class="layui-form-item">
                <label class="layui-form-label">参数名称</label>
                <div class="layui-input-block">
                    <input type="text" name="paramName" required lay-verify="required" placeholder="请输入参数名称"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">参数标志</label>
                <div class="layui-input-block">
                    <input type="text" name="paramFlag" required lay-verify="required" placeholder="请输入参数标志"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否必须</label>
                <div class="layui-input-block">
                    <select name="required" lay-verify="required">
                        <option value="1" selected>是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序号</label>
                <div class="layui-input-block">
                    <input type="text" name="sortNum" required lay-verify="required" placeholder="请输入排序号"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: right">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="templateParamSave">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

    <div id="templateStructureDiv" class="popLayer" style="display: none;">
        <form id="templateStructureForm" class="layui-form" lay-filter="templateStructureForm" style="width: 810px;margin-top: 30px;">
            <input type="hidden" name="hbgtsId">
            <input type="hidden" name="hbgtId">
            <input type="hidden" name="parentId">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">节点名称</label>
                    <div class="layui-input-inline" style="width: 130px;">
                        <input type="text" name="hbgtsName" required lay-verify="required" placeholder="请输入节点名称"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">子节点</label>
                    <div class="layui-input-inline" style="width: 80px;">
                        <input type="checkbox" name="isChild" lay-skin="switch" lay-text="是|否" checked value="1">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">节点类型</label>
                    <div class="layui-input-inline" style="width: 130px;">
                        <select name="hbgtsType" lay-verify="required">
                            <option value=""></option>
                            <option value="1">目录</option>
                            <option value="2">模板文件</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">排序号</label>
                    <div class="layui-input-inline" style="width: 100px;">
                        <input type="text" name="sortNum" required lay-verify="required|number" placeholder="请输入排序号"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">节点说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="请输入节点说明"
                              class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">节点内容</label>
                <div class="layui-input-block">
                    <textarea name="content" placeholder="请输入节点内容"
                              class="layui-textarea" style="height: 200px;"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: right">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="templateStructureSave">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>